#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> pii;
// priority_queue<int, vector<int>, less<int>> pq;

void solve() {
    int n;
    cin >> n;
    vector<int> a(n + 1);
    for(int i = 1; i <= n; i++) cin >> a[i];
    int l = 1, r = 1;
    int ans = 0;
    for(int i = 1; i <= n; i++) {
        int cnt = 0;
        for(int j = i + 1; j <= n; j++) {
            if(a[j] < a[i]) {
                cnt++;
                if(cnt > ans) {
                    ans = cnt;
                    l = i, r = j;
                }
            }else if(a[j] > a[i]) cnt--;
        }
    }
    cout << l << ' ' << r << endl;
}

signed main() {
    int t; cin >> t;
    while(t--) solve();
    return 0;
}